//
//  CoverView.m
//  小团购
//
//  Created by 樊荣海 on 15/2/3.
//  Copyright (c) 2015年 樊荣海. All rights reserved.
//

#import "CoverView.h"

@implementation CoverView

- (instancetype)initWithFrame:(CGRect)frame {

    if (self == [super initWithFrame:frame]) {
        
        self.backgroundColor = [UIColor blackColor];
        self.alpha = 0.5;
        self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    }
    
    return self;
}

+ (id)cover {

    return [[self alloc] init];
}

+ (id)coverWithTarget:(id)target action:(SEL)selector {


    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:target action:selector];
    
    CoverView *view = [self cover];
    [view addGestureRecognizer:tap];
    
    return view;
}

- (void)resetAlpha {

    self.alpha = 0.5;
}


@end
